﻿<Window x:Class="TestApplication.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
				xmlns:prism="http://www.codeplex.com/prism"
				xmlns:loc="clr-namespace:TestApplication"
				xmlns:sys="clr-namespace:System;assembly=mscorlib"
				xmlns:ext="clr-namespace:Prism.RibbonRegionAdapter;assembly=Prism.RibbonRegionAdapter"
        Title="MainWindow" Height="350" Width="800">
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="Auto"/>
			<RowDefinition Height="*"/>
		</Grid.RowDefinitions>
		<Ribbon prism:UIElementExtension.MergeOrder="10"
						x:Name="MainMenu" x:FieldModifier="protected internal"
						prism:RegionManager.RegionName="{x:Static loc:ShellRegions.MainMenu}">
			<RibbonTab Header="General"
								 prism:UIElementExtension.MergeKey="{x:Static loc:MainMenuMergeKeys.GeneralTab}"
								 prism:UIElementExtension.MergeOrder="10">
				<RibbonGroup Header="Group 1">
					<RibbonButton Label="Group1.Button1 (Main)" Command="{Binding HelloCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" />
				</RibbonGroup>
				<RibbonGroup Header="Group 2"
										 prism:UIElementExtension.MergeKey="{x:Static loc:MainMenuMergeKeys.GeneralTabGroup2}">
					<RibbonButton Label="Group2.Button1 (Main)" Command="{Binding HelloCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" />
					<RibbonButton Label="Group2.Button2 (Main)" Command="{Binding HelloCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" />
				</RibbonGroup>
			</RibbonTab>
			<RibbonTab Header="Last Tab"
								 prism:UIElementExtension.MergeKey="{x:Static loc:MainMenuMergeKeys.LastTab}"
								 prism:UIElementExtension.MergeOrder="{x:Static sys:Double.MaxValue}">
			</RibbonTab>
		</Ribbon>
		<StackPanel Grid.Row="1" Orientation="Horizontal">
			<StackPanel.Resources>
				<Style TargetType="{x:Type Button}">
					<Setter Property="Margin" Value="2,4" />
					<Setter Property="Padding" Value="5,2" />
				</Style>
			</StackPanel.Resources>
			<Button Content="Add Module-Ribbon" Command="{Binding LoadModule1RibbonCommand}" />
			<Button Content="Remove Module-Ribbon" Command="{Binding UnloadModule1RibbonCommand}" />
		</StackPanel>
		<TextBox Grid.Row="2" AcceptsReturn="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
			<TextBox.ContextMenu>
				<ContextMenu x:Name="CtxMenu" prism:RegionManager.RegionName="{x:Static loc:ShellRegions.EditorContextMenu}">
					<MenuItem Header="B1 (Main)" Command="{Binding HelloCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" />
					<MenuItem Header="B2 (Main)" Command="{Binding HelloCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}">
						<MenuItem Header="B2.1 (Main)" Command="{Binding HelloCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" />
						<MenuItem Header="B2.2 (Main)" Command="{Binding HelloCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" />
					</MenuItem>
					<Separator />
					<MenuItem Header="B3 (Main)" Command="{Binding HelloCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}" />
				</ContextMenu>
			</TextBox.ContextMenu>
			<TextBox.Text>Right-Click me for a merged context-menu with preserved DataContext</TextBox.Text>
		</TextBox>
	</Grid>
</Window>
